<div class="block-flat" id="a----<%= article.id %>">
  <div class="header">
    <h3><%= article.title %></h3>
  </div>
  <div class="content">
    <p><%= raw article.preview.body %></p>
    <div class="spacer2 text-center">
      <% if article.published_at.blank? %>
          <%= link_to fa_i_with_text(' 发布', 'edit'), toggle_publish_backend_article_path(article),
                      method: :patch, remote: true, class: 'btn btn-primary btn-fla' %>
      <% else %>
          <%= link_to fa_i_with_text(' 取消发布', 'edit'), toggle_publish_backend_article_path(article),
                      method: :patch, remote: true, class: 'btn btn-default btn-fla' %>
      <% end %>

      <div class="btn-group">
        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
          编辑<span class="caret"></span>
        </button>
        <ul class="dropdown-menu" role="menu">
          <li><%= link_to fa_i_with_text(' 正文', 'edit'), edit_backend_article_path(article) %></li>
          <li><%= link_to fa_i_with_text(' 信息', 'edit'), edit_profile_backend_article_path(article) %></li>
        </ul>
      </div>

      <div class="btn-group category-dropdown">
        <%= render 'category_dropdown', categories: @categories, article: article %>
      </div>

      <%= link_to fa_i_with_text(' 删除', 'times'), backend_article_path(article),
                  method: :delete, remote: true, class: 'btn btn-danger btn-fla', data: {confirm: 'OK?'} %>
    </div>
  </div>
  <div class="time-info">
    <% unless article.published_at.blank? %>
        <span>发布时间：<%= l article.published_at, format: :long %></span>
    <% end %>
    <span>创建时间：<%= l article.created_at, format: :long %></span>
    <span>修改时间：<%= l article.updated_at, format: :long%></span>
  </div>
</div>